package test;

import java.util.Scanner;

public class Tit7 {
	public static void main(String[] args) {
		int a,b,c,d;
		Scanner scan=new Scanner(System.in);
		a =scan.nextInt();
		b =scan.nextInt();
		c =scan.nextInt();
		d =scan.nextInt();
		int max = a>b ? (a>c ? (a>d ? a:d):(c>d ? c:d)):(b>c ? (b>d ? b:d):(c>d ? c:d));
		System.out.println("最大值" + max);
		int min = a<b ? (a<c ? (a<d ? a:d):(c<d ? c:d)):(b<c ? (b<d ? b:d):(c<d ? c:d));
		System.out.println("最小值" + min);
	}
}
